﻿using System.Configuration;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for Utils
/// </summary>
public class Utils
{
    #region Properties
    public static string ErrorPage { get { return "~/ErrorReporting.aspx"; } }
    #endregion

    #region Constructors
    public Utils()
    {
        //no constructor logic here
    }
    #endregion

    #region Connection string
    public static string ConnectionString
    {
        get { return ConfigurationManager.ConnectionStrings["xxx"].ConnectionString; }
    }
    #endregion

    #region Show message Methods
    public static void ShowSuccess(Label lblMessage, string message, string toolTip)
    {
        ShowSuccess(lblMessage, message);
        lblMessage.ToolTip = toolTip;
    }
    public static void ShowSuccess(Label lblMessage, string message)
    {
        lblMessage.Text = string.Format("<div class=\"success-div\">{0}</div><br/>", message);
    }
    public static void ShowWarning(Label lblMessage, string message)
    {
        lblMessage.Text = string.Format("<div class=\"warning-div\">{0}</div><br/>", message);
    }
    public static void ShowWarning(Label lblMessage, string message, string toolTip)
    {
        lblMessage.ToolTip = toolTip;
        ShowWarning(lblMessage, message);
    }
    public static void ShowError(Label lblMessage, string message, string toolTip)
    {
        ShowError(lblMessage, message);
        lblMessage.ToolTip = toolTip;
        //lblMessage.Text = "<div style=\"background-color:Red;\">" + message + "</div>";
    }
    public static void ShowError(Label lblMessage, string message)
    {
        lblMessage.Text = string.Format("<div class=\"error-div\">{0}</div><br/>", message);
        //ErrorPopup(message);
    }
    #endregion
}